#include <bits/stdc++.h>

using namespace std;
#define int long long


void solve()
{
    int k;
    cin >> k;
    if(k % 3 == 1) cout << "YES" << endl;
    else cout << "NO" << endl;
}
signed main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}